package com.jx.smartbot.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jx.smartbot.entityListener.WpAssistantListener;

import java.util.Date;


/**
 * The persistent class for the wp_assistant_agent database table.
 * 
 */
@Entity
@Table(name="wp_assistant_agent")
@NamedQuery(name="WpAssistantAgent.findAll", query="SELECT w FROM WpAssistantAgent w")
@EntityListeners(WpAssistantListener.class)
public class WpAssistantAgent implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time")
	private Date createTime;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="update_time")
	private Date updateTime;

	@Column(name="user_id")
	private String userId;
	@Transient
	private String userName;

	//bi-directional many-to-one association to WpAssistant
	@ManyToOne(fetch = FetchType.EAGER)
	//@ManyToOne
	@JoinColumn(name="assistant_id")
	@JsonBackReference
	private WpAssistant wpAssistant;

	public WpAssistantAgent() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public WpAssistant getWpAssistant() {
		return this.wpAssistant;
	}

	public void setWpAssistant(WpAssistant wpAssistant) {
		this.wpAssistant = wpAssistant;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

}